#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

class Solution {
public:
    int hammingDistance(int x, int y) {
        int z = x^y;
        int sum = 0;
        while(z!=0){
            sum = sum+1;
            z&=z-1;
        }
        return sum;
    }
};